<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title><?php echo $title;?></title>
    <!-- 设置缩放 -->
    <meta name="viewport" content="minimal-ui,width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <!-- IOS中禁用将数字识别为电话号码/忽略Android平台中对邮箱地址的识别 -->
    <meta name="format-detection" content="telephone=no" />
    <!-- windows phone 点击无高光 -->
    <meta name="msapplication-tap-highlight" content="no" />
    <!-- icon -->
    <link rel="shortcut icon" href="<?php echo ADMIN_ICO_PIC;?>" type="image/x-icon"/>
    <link rel="bookmark" href="<?php echo ADMIN_ICO_PIC;?>"/>
    <!-- css -->
    <link rel="stylesheet" type="text/css" href="<?php echo SYS_LINK;?>admin/css/admin.css?v=<?php echo V_CSSJS;?>" />
    <style>
        <?php
        $leftNavWidth = intval($GLOBALS['ADMIN']['left_nav_width']) ? intval($GLOBALS['ADMIN']['left_nav_width']) : 200;
        ?>
        /*左侧菜单 默认200*/
        .left_box {width: calc(<?php echo $leftNavWidth;?>px + 0px);}
        .right_box{left: calc(<?php echo $leftNavWidth;?>px + 0px);}
        .menu_con {width: calc(<?php echo $leftNavWidth;?>px + 20px);}
        .menu_con ul li {width: calc(<?php echo $leftNavWidth;?>px + 0px);}
        .menu_con ul li a {width: calc(<?php echo $leftNavWidth;?>px - 20px);}
        
    </style>
    <!-- js -->
    <script>
        var navWidth = '<?php echo $leftNavWidth;?>';
    </script>
</head>
<?php
$adminName = isset($adminName) ? $adminName : '';
$webname = isset($webname) ? $webname : '';
?>
<body class="noselect">
<!-------------------- left_box( -------------------->
<div class="left_box">
    <div class="left_top">
        <a href=""><?php if($adminName == 'develop'){echo '<font color="red">开发者模式</font>';}else{echo $webname;} ?></a>
    </div>
    <div class="left_con">
        <!-- menu_box( -->
        <div class="menu_con">
            <ul>
                <?php
                function navLeftBox($info){
                    echo '<b class="find_btn"></b>';
                    echo '<dl>';
                    foreach($info as $v){
                        if($v['status'] != 2) {
                            echo '<dd>';
                            //$setUrl = isset($v['child']) ? 'javascript:;' : (isset($v['seturl']) ? $v['seturl'] : '');
                            $setUrl = isset($v['seturl']) ? $v['seturl'] : 'javascript:;';
                            $setUrl = isset($v['adminurl']) && $v['adminurl'] ? (strpos($v['adminurl'], 'javascript:') === false ? SYS_HOST . $v['adminurl'] : $v['adminurl']) : $setUrl;
                            echo '<a href="' . $setUrl . '" class="nav2" target="iframe_con" title="' . $v['menuname'] . '">' . $v['menuname'] . '</a>';
                            if (isset($v['child']) && !empty($v['child'])) {
                                navLeftBox($v['child']);
                            }
                            echo '</dd>';
                        }
                    }
                    echo '</dl>';
                }
                // 左侧导航
                foreach($navLeft as $k=>$v){
                    if($v['status'] != 2){
                        echo '<li>';
                        //$setUrl = isset($v['child']) ? 'javascript:;' : (isset($v['seturl']) ? $v['seturl'] : '');
                        $setUrl = isset($v['seturl']) ? $v['seturl'] : 'javascript:;';
                        $setUrl = isset($v['adminurl']) && $v['adminurl'] ? (strpos($v['adminurl'],'javascript') === false ? SYS_HOST.$v['adminurl'] : $v['adminurl']) : $setUrl;
                        echo '<a href="'.$setUrl.'" class="nav1" target="iframe_con" title="'.$v['menuname'].'">'.$v['menuname'].'</a>';
                        if(isset($v['child']) && !empty($v['child'])){
                            navLeftBox($v['child']);
                        }
                        echo '</li>';
                    }
                }
                ?>
            </ul>
        </div>
        <!-- menu_box) -->
    </div>
</div>
<!-------------------- left_box) -------------------->

<!-------------------- right_box( -------------------->
<div class="right_box">
    <!-- right_top_box( -->
    <div class="right_top">
        <div class="right_top_left">
            <span class="right_top_btn1" title="左侧显示/隐藏"></span>
            <a class="right_top_btn2" title="系统主页" href="" ></a>
        </div>
        <div class="right_top_right">
            <span class="right_top_btn4" title="当前黑白(下个简白)">◨</span>
            <a target="_blank" class="right_top_btn3" title="网站前端" href="<?php echo SYS_HOST;?>" ></a>
            <span class="user_info">
                <div class="user_name">
                    <img src="<?php echo $headimg;?>" class="headimg" />&nbsp;&nbsp;&nbsp;
                    <?php echo $adminName;?>
                </div>
                <div class="user_menu">
                    <ul>
                        <?php
                        if($userLevel != 1){
                            echo '<li><a href="'.SYS_URL_PATH("admin_user_infoup/m/sysuser/c/3/f/0/i/$userId").'" target="iframe_con">用户中心</a></li>';
                        }
                        ?>
                        <li><a href="<?php echo SYS_URL_PATH('admin_login_out')?>">退出登录</a></li>
                    </ul>
                </div>
            </span>
        </div>
        <div class="right_top_menu">
            <div class="right_top_menu_con">
                <ul>
                    <?php
                    if($userLevel == 1){
                        echo '<li><a target="iframe_con" href="'.SYS_URL_PATH('admin_mould').'" title="模型管理" >模型管理</a></li>'.PHP_EOL;
                    }
                    ?>
                    <!--<li><a target="iframe_con" href="<?php /*echo SYS_URL_PATH('admin_menu')*/?>" title="菜单管理" >菜单管理</a></li>
                    <li><a target="iframe_con" href="<?php /*echo SYS_URL_PATH('admin_fieldtpl')*/?>" title="字段模版" >字段模版</a></li>
                    <li><a target="iframe_con" href="<?php /*echo SYS_URL_PATH('admin_power')*/?>" title="权限管理" >权限管理</a></li>
                    <li><a target="iframe_con" href="<?php /*echo SYS_URL_PATH('admin_sysuser')*/?>" title="系统用户" >系统用户</a></li>-->
                    <?php
                    if(isset($navTop)){
                        foreach($navTop as $k=>$v){
                            if(!$v['fid']){
                                if($v['status'] != 2){
                                    $url = isset($v['seturl']) ? $v['seturl'] : '';
                                    $navName = $v['menuname'];
                                    echo '<li><a target="iframe_con" href="'.$url.'" >'.$navName.'</a></li>';
                                }
                            }
                        }
                    }
                    ?>
                    <?php
                    /*if($userLevel == 1){
                        echo '<li><a target="iframe_con" href="'.SYS_URL_PATH('admin_syslog').'" title="系统日志" >系统日志</a></li>'.PHP_EOL;
                    }*/
                    ?>
                    <!--<li><a target="iframe_con" href="<?php /*echo SYS_URL_PATH('admin_system')*/?>" title="系统管理" >系统管理</a></li>-->
                </ul>
            </div>
        </div>
    </div>
    <!-- right_top_box) -->

    <!-- right_content ( -->
    <div class="iframe_box">
        <iframe src="<?php echo SYS_URL_PATH('admin_index_main')?>" width="100%" height="100%" id="iframe_con" name="iframe_con" frameborder="0" scrolling="auto"> 您的浏览器不支持嵌入式框架，或者当前配置为不显示嵌入式框架。 </iframe>
    </div>
    <!-- right_content ) -->

</div>
<!-------------------- right_box) -------------------->
<script language="javascript">
    var http_url = '<?php echo SYS_HOST;?>';
    var http_link = '<?php echo SYS_LINK;?>';
    var cssjsv = '<?php echo V_CSSJS;?>';
    var http_fix = '<?php echo SYS_URL_FIX;?>';
</script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>admin/js/jquery.min.js?v=<?php echo V_CSSJS;?>"></script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>admin/js/admin.js?v=<?php echo V_CSSJS;?>"></script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>admin/js/skin.js?v=<?php echo V_CSSJS;?>"></script>
<script type="text/javascript">

</script>
</body>
</html>